<%@ page language="java"
	import="java.util.*,com.BMS.entity.Reader.*,com.BMS.entity.Manager.*"
	pageEncoding="utf-8"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>图书管理系统</title>

<link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css">

<script src="./js/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="./js/bootstrap.js" type="text/javascript"></script>

<!-- 使按键失效，用于权限控制  -->
<style type="text/css">
.disable {
	style ="pointer-events: none";
}
</style>

<!-- 导航栏图书检索 -->
<script type="text/javascript">
	function toSearch() {
		window.location.href = "./Book/BookSearch.jsp?book_id=" + document.getElementById("book_id").value;
	}
</script>
</head>

<body>

	<!-- 大背景 -->
	<div class="container" align="center"
		style=" width:auto; height:768px; background-color:#BFEDEA; background-image:url(./img/bg2.png); -moz-background-size:100% 100%; background-size:100% 100%;">

		<!-- 导航栏 -->
		<div style="width:100%; height:auto;">
			<nav class="navbar navbar-default">
				<div class="container-fluid">
					<!-- Brand and toggle get grouped for better mobile display -->
					<div class="navbar-header">

						<a class="navbar-brand" href="./main.jsp">首页</a>
					</div>
					<!-- Collect the nav links, forms, and other content for toggling -->
					<div class="collapse navbar-collapse" id="defaultNavbar1">
						<ul class="nav navbar-nav">
							<!-- 图书管理下拉框 -->
							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown" role="button" aria-expanded="false">图书管理<span
									class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li><a id="bookManage" href="./Book/BookManage.jsp">管理图书</a></li>
									<li><a id="bookSearch" href="./Book/BookSearch.jsp">图书查询</a></li>
									<li><a id="bookBorrow" href="./Book/BookBorrow.jsp">图书借阅</a></li>
									<li><a id="bookReturn" href="./Book/BookReturn.jsp">图书归还</a></li>
								</ul></li>
								
							<!-- 违规管理下拉框 -->
							<li class="dropdown" id="violation_manage"><a href="#"
								class="dropdown-toggle" data-toggle="dropdown" role="button"
								aria-expanded="false">违规管理<span class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li><a href="./Violation/ViolationManage.jsp">管理违规记录</a></li>
									<li><a href="./Violation/ViolationReg.jsp">违规登记</a></li>
								</ul></li>

							<!-- 个人中心下拉框 -->
							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown" role="button" aria-expanded="false">个人中心<span
									class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li><a href="./User/PersonalImfo.jsp">个人资料</a></li>
									<li id="bookHistory"><a href="./User/BookHistory.jsp">借阅记录</a></li>
									<li id="violationHistory"><a
										href="./User/ViolationHistory.jsp">违规记录</a></li>
									<li><a href="./User/Logout.do">退出登录</a></li>
								</ul></li>

						</ul>
						<!-- 搜索栏 -->
						<div style="float:right;">
							<form class="navbar-form navbar-left" role="search">
								<div class="form-group">
									<input type="text" id="book_id" class="form-control"
										placeholder="输入图书编号">
								</div>
								<button type="button" class="btn btn-default"
									onclick="toSearch()">查询</button>
							</form>
						</div>

					</div>
					<!-- /.navbar-collapse -->
				</div>
				<!-- /.container-fluid -->
			</nav>
		</div>
		
		<!-- 轮播框 -->
		<div id="myCarousel" class="carousel slide" style="width:100%; height:85%;">
			<!-- 轮播（Carousel）指标 -->
			<ol class="carousel-indicators">
				<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
				<li data-target="#myCarousel" data-slide-to="1"></li>
				<li data-target="#myCarousel" data-slide-to="2"></li>
			</ol>   

			<!-- 轮播（Carousel）项目 -->
			<div class="carousel-inner" style="width:100%; height:100%;">
				<div class="item active">
					<img src="./img/book21.png" alt="First slide" onclick="location='./Book/BookSearch.jsp?book_id=21'">
				</div>
				<div class="item">
					<img src="./img/book22.png" alt="Second slide" onclick="location='./Book/BookSearch.jsp?book_id=22'">
				</div>
				<div class="item">
					<img src="./img/book23.png" alt="Third slide" onclick="location='./Book/BookSearch.jsp?book_id=23'">
				</div>
			</div>
			<!-- 轮播（Carousel）导航 -->
			<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
	   			<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
	   			<span class="sr-only">Previous</span>
			</a>
			<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
	    		<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
	    		<span class="sr-only">Next</span>
			</a>
		</div>
		<script>
			$("#myCarousel").carousel('cycle');
		</script>	
	</div>
</body>

<!-- 权限控制 -->
<script type="text/javascript">
 	var user_type = "<%=session.getAttribute("user_type")%>";
 	if(user_type!=null) {
 		if(user_type=="reader") {
			document.getElementById("bookManage").style['pointer-events'] = 'none';
			document.getElementById("bookBorrow").style['pointer-events'] = 'none';
			document.getElementById("bookReturn").style['pointer-events'] = 'none';
 		} else {
 			document.getElementById("bookHistory").style['pointer-events'] = 'none';
 			document.getElementById("violationHistory").style['pointer-events'] = 'none';
 		}
 	}
</script>

</html>
